/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.securityrat.entities_temp;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author p.vivoli
 */
@Embeddable
public class RelSpPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_system")
    private int idSystem;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 4)
    @Column(name = "id_perimetro")
    private String idPerimetro;

    public RelSpPK() {
    }

    public RelSpPK(int idSystem, String idPerimetro) {
        this.idSystem = idSystem;
        this.idPerimetro = idPerimetro;
    }

    public int getIdSystem() {
        return idSystem;
    }

    public void setIdSystem(int idSystem) {
        this.idSystem = idSystem;
    }

    public String getIdPerimetro() {
        return idPerimetro;
    }

    public void setIdPerimetro(String idPerimetro) {
        this.idPerimetro = idPerimetro;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idSystem;
        hash += (idPerimetro != null ? idPerimetro.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RelSpPK)) {
            return false;
        }
        RelSpPK other = (RelSpPK) object;
        if (this.idSystem != other.idSystem) {
            return false;
        }
        if ((this.idPerimetro == null && other.idPerimetro != null) || (this.idPerimetro != null && !this.idPerimetro.equals(other.idPerimetro))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.securityrat.entities.RelSpPK[ idSystem=" + idSystem + ", idPerimetro=" + idPerimetro + " ]";
    }
    
}
